package com.example.iqiyitest;


import android.os.Bundle;
import android.util.Log;

import com.example.iqiyitest.activity.DetailForMovieActivity;
import com.example.iqiyitest.base.Constants;
import com.example.iqiyitest.hztvpaysdk.BasePayListenerActivity;
import com.example.iqiyitest.hztvpaysdk.HztvPayUtil;
import com.example.iqiyitest.hztvpaysdk.PushMessage;
import com.example.iqiyitest.hztvpaysdk.PushMessage.Data;
import com.google.gson.Gson;

/**
 * Only used to test this sdk.
 * Created by zhanglong on 4/5/2016.
 */
public class PayListenerActivity extends BasePayListenerActivity {

    private static final String TAG = "PayListenerActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        HztvPayUtil.init(getApplication(), "test", "test");
    }

    @Override
    protected void onPayResult(PushMessage.Data data) {
        Log.d(TAG, "Received payment result: " + new Gson().toJson(data));
        PushMessage.Data data2=data;
        if(data2.Message.equals("支付成功")){
        	com.example.iqiyitest.base.Constants.setMovie_flag("2");
        	if(Constants.getMovie_activity().equals("DetailForMovieActivity")) {
        		DetailForMovieActivity.ifplay=true;
        	}
        }
    }

}
